<template>
	<u-mask class="mask" :zoom="false" :show="props.isShow"
		:custom-style="{ height: tools.clientTopHight(), bottom: '100rpx', top: 'auto' }"
		@click="emit('close', false)">
		<view class="content" @click.stop>
			<view class="header">
				<view class="header_left">
					<view class="header_line"></view>
					<view class="header_text">
						选择组别
					</view>
				</view>
				<image class="close" src="/pagesA/static/image/28.png" @click="emit('close', false)"></image>
			</view>
			<!-- props.listData -->
			<view class="bottom" v-for="(item,index) in props.listData" :key="index" >
				<view :class="item.choose ? 'bottom_item2' : 'bottom_item'" class="flex-space-between"
					@click="chooseClick(index)">
					<image class="img_choose" v-if="item.choose" src="/pagesA/static/image/choose.png"></image>
					<view class="bottom_item_left">
						<view >{{item.name}}</view>
						<view style="font-weight: 100;font-size: 26rpx;margin-top: 10rpx;">{{item.brief}}</view>
					</view>
					<view class="bottom_item_right">
						{{item.price==0 ? "免费" : "¥"+item.price}}
					</view>
				</view>
			</view>
		</view>
	</u-mask>
</template>

<script setup lang="ts">
	import tools from '@/utils/tools'
	import { nextTick } from 'process';
	const emit = defineEmits(['close', 'poster'])
	const props = defineProps({
		isShow: {
			type: Boolean,
			default() {
				return false
			}
		},
		listData: {
			type: Array,
			default() {
				return []
			}
		}
	})
	// 点击 nav
	const chooseClick = (index : any) => {
		props.listData.forEach((res  :any) => {
			res.choose = false
		})
		props.listData[index].choose = true
		let data=({
			listData:props.listData,
			chooseData:props.listData[index]
		})
		emit('groupChoose', data)
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		bottom: 0;
		position: absolute;
		background-color: white;
		opacity: 1;
		border-radius: 40rpx 40rpx 0rpx 0rpx;
		padding: 20rpx 30rpx;
	}

	.header {
		width: 100%;
		height: 76rpx;
		color: #333333;
		font-size: 32rpx;
		line-height: 76rpx;
		position: relative;
		text-align: center;
		display: flex;
		align-items: center;
		// background-color: #eeeeee;
		border-radius: 10rpx 10rpx 0px 0px;

		.header_left {
			display: flex;
			align-items: center;

			.header_line {
				width: 8rpx;
				height: 30rpx;
				background: rgba(80, 98, 167);
			}

			.header_text {
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #000000;
				margin-left: 5rpx;
			}
		}

		.close {
			top: 30rpx;
			right: 10rpx;
			width: 20rpx;
			height: 20rpx;
			position: absolute;
		}
	}

	.bottom {
		// margin: 54rpx 120rpx;
		z-index: 9999999 !important;
		margin-top: 20rpx;
		position: relative;

		.img_choose {
			position: absolute;
			right: 0;
			top: 0;
			width: 76rpx;
			height: 76rpx;
		}

		.bottom_item {
			width: 100%;
			height: 160rpx;
			background: rgba(252, 252, 252, 0.39);
			border: 2px solid #CCCCCC;
			opacity: 1;
			border-radius: 20rpx;
			padding: 32rpx;
		}

		.bottom_item2 {
			height: 160rpx;
			background: rgba(238, 242, 255, 0.39);
			border: 2px solid #5062A7;
			opacity: 1;
			border-radius: 20rpx;
			padding: 32rpx;
			color: #354678;
		}

		.bottom_item_left {
			font-size: 32rpx;
			font-weight: bold;
			margin-right: 10rpx;
		}

		.bottom_item_right {
			// position: absolute;
			// right: 40rpx;
			width: 140rpx;
			height: 50rpx;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #F24C55;
			opacity: 1;
		}
	}
</style>